<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\common\PayWaySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Pay Ways';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row">
    <div class="col-xs-12">
        <div class="box">
            <div class="box-header">
                <h1 class="box-title"><?= $this->title; ?></h1>
            </div>
            <div class="box-body table-responsive">
                <h1><?= Html::encode($this->title) ?></h1>
                <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

                <p>
                    <?= Html::a('Create Pay Way', ['create'], ['class' => 'btn btn-success']) ?>
                </p>

                <?= GridView::widget([
                    'dataProvider' => $dataProvider,
                    'filterModel' => $searchModel,
                    'tableOptions' => ['class' => 'table table-hover'],
                    'columns' => [
                        ['class' => 'yii\grid\SerialColumn',
                            'visible' => false,
                        ],
                        [
                            'attribute' => '图标',
                            'filter' => false,
                            'format' => 'raw',
                            'contentOptions' => [
                                'width' => '100'
                            ],
                            'value' => function ($model) {
                                return Html::img(unserialize($model->href), 
                                [
                                    'width' => '50px',
                                    'class' => 'rf-img-md img-bordered-sm',
                                    ]);
                            },
                        ],
                        [
                            'attribute' => '支付名称',
                            'filter' => false,
                            'format' => 'raw',
                            'contentOptions' => [
                                'width' => '100'
                            ],
                            'value' => function ($model) {
                                return $model->name;
                            },
                        ],
                        //'id',
                        //  ['class' => 'yii\grid\ActionColumn'],
                    ],
                ]); ?>
            </div>
